/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager.test;

import java.awt.BorderLayout;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.HashMap;
import javax.swing.JFrame;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JRViewer;
import net.sf.jasperreports.view.JasperViewer;

/**
 *
 * @author THIAGO
 */
public class MainTeste {

    public void abrirRelatorio() {
        try {
            Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/manager", "root", "taldiengenharia");
            InputStream inputStream = getClass().getResourceAsStream("ReportTeste.jasper");
            HashMap hashMap = new HashMap();
            JasperPrint print = JasperFillManager.fillReport(inputStream, hashMap, connection);

            JasperViewer.viewReport(print,false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
       MainTeste mainTeste = new MainTeste();
       mainTeste.abrirRelatorio();
    }
}
